const Koa = require('koa');
// const Router = require('@koa/router');

const app = new Koa();
// const router = new Router();
// const  usersRouter = require('./router/users');

const bodyParser = require('koa-bodyparser')
// 使用ctx.body解析中间件
app.use(bodyParser())

const router =require('./routers/index.js') 


app.use(router.routes(), router.allowedMethods())
// 加载路由中间件
// app.use(router.routes()).use(router.allowedMethods())

app.listen(3000, () => {
  console.log('[zhizhe] is starting at port 3000')
})
